home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
batch
/
library
/
locate
/
locate.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-03-09
|
1KB
|
46 lines
PROGRAM Locate;
{Written March 1991 by Andrew J. White. See LOCATE.DOC for usage}
uses crt;
var X,Y,Code: Integer;
begin
If ParamCount < 2 then {Coordinates not specified, show usage}
begin {if}
Writeln ('LOCATE v1.0 (c) 1991 by Andrew J. White: ß-test');
Writeln;
Writeln ('usage: ',ParamStr(0),' X Y');
Writeln (' where X and Y are the cursor coordinates.');
Halt(1); {Exit and set error level to 1}
end; {if}
Val(ParamStr(1),X,Code); {Get X coordinate, put in X}
Val(ParamStr(2),Y,Code); {Get Y coordinate, put in Y}
If (X<1) or (X>80) then {Check X coordinate for validity}
begin {if}
Writeln;
Writeln ('ERROR: Invalid X coordinate: ',X);
Halt(1); {Exit and set ErrorLevel to 1}
end; {if}
If (Y<1) or (Y>25) then {Check Y coordinate for validity}
begin {if}
Writeln;
Writeln ('ERROR: Invalid Y coordinate: ',Y);
Halt(1); {Exit and set ErrorLevel to 1}
end; {if}
GotoXY(X,Y); {Go to specified coordinate}
Halt(0); {Exit with no error}
end.